package com.sinosoft.sinopay.web.batch.config;

/**
 * 【 批扣类型枚举类 】
 *
 * @author chenzhiheng
 * @version V1.0
 * @date 16/12/20
 */
public enum  ENUM_BIZ_TRANSTYPE {

    APPLY_NEW("101","银保通批扣收费"),CONFIRM_CONT("102","普通批扣收费"),CONFIRM_SEARCH("103","批量查询");
    /** 枚举code */
    private String code;
    /** 枚举value或者code说明 */
    private String value;

    ENUM_BIZ_TRANSTYPE(String code,String value){
        this.code = code;
        this.value = value;
    }
    /**
     * 获得枚举code值
     * @Title: code
     * @Description: TODO
     * @return
     */
    public String code(){
        return code;
    }
    /**
     * 获得枚举value值
     * @Title: decription
     * @Description: TODO
     * @return
     */
    public String description(){
        return value;
    }

    /**
     * 根据key获得value
     * @param key
     * @return
     */
    public static String getEnumValueByKey(String key){
        for(ENUM_BIZ_TRANSTYPE enumItem:ENUM_BIZ_TRANSTYPE.values()){
            if(key.equals(enumItem.code())){
                return enumItem.description();
            }
        }
        return "";
    }
}
